home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / icon8_fx.zoo / diffs / icont.dif < prev    next >
Encoding:
Text File  |  1991-02-18  |  28.3 KB  |  1,074 lines

  1. *** old\globals.h
  2. --- globals.h
  3. **************
  4. *** 33,35
  5.   
  6. ! #if ATARTI_ST
  7.   Global char *patharg    Init(0);    /* -p: path for finding iconx */
  8. --- 33,35 -----
  9.   
  10. ! #if ATARI_ST
  11.   Global char *patharg    Init(0);    /* -p: path for finding iconx */
  12. **************
  13. *** 38,39
  14.   Global int silent    Init(0);    /* -s: suppress info messages? */
  15.   Global int m4pre    Init(0);    /* -m: use m4 preprocessor? [UNIX] */
  16. --- 38,40 -----
  17.   Global int silent    Init(0);    /* -s: suppress info messages? */
  18. + #ifdef UNIX
  19.   Global int m4pre    Init(0);    /* -m: use m4 preprocessor? [UNIX] */
  20. **************
  21. *** 39,40
  22.   Global int m4pre    Init(0);    /* -m: use m4 preprocessor? [UNIX] */
  23.   Global int uwarn    Init(0);    /* -u: warn about undefined ids? */
  24. --- 40,42 -----
  25.   Global int m4pre    Init(0);    /* -m: use m4 preprocessor? [UNIX] */
  26. + #endif
  27.   Global int uwarn    Init(0);    /* -u: warn about undefined ids? */
  28. *** old\lmem.c
  29. --- lmem.c
  30. **************
  31. *** 21,22
  32.   #if AMIGA || ATARI_ST || HIGHC_386 || MACINTOSH || VMS
  33.      /* nothing is needed */
  34. --- 21,25 -----
  35.   #if AMIGA || ATARI_ST || HIGHC_386 || MACINTOSH || VMS
  36. + #ifdef __GNUC__
  37. + #include <stat.h>
  38. + #else
  39.      /* nothing is needed */
  40. **************
  41. *** 22,23
  42.      /* nothing is needed */
  43.   #endif                    /* AMIGA || ATARI_AT || HIGHC_386 ... */
  44. --- 25,27 -----
  45.      /* nothing is needed */
  46. + #endif
  47.   #endif                    /* AMIGA || ATARI_AT || HIGHC_386 ... */
  48. **************
  49. *** 138,139
  50.   
  51.      if (ipath == NULL)
  52. --- 142,145 -----
  53.   
  54. + #ifdef __GNU__  /* no really good reason for the code below */
  55. +         /* current working directory is searched first in any case */
  56.      if (ipath == NULL)
  57. **************
  58. *** 184,185
  59.    */
  60.   
  61. --- 190,192 -----
  62.    */
  63. + #endif                    /* __GNUC__ */
  64.   
  65. **************
  66. *** 296,297
  67.   
  68.         pptr = ipath;
  69. --- 303,308 -----
  70.   
  71. + #ifdef __GNUC__
  72. +       /* skip this search if IPATH is not defined */
  73. +       if (NULL != (pptr = ipath)) {
  74. + #else
  75.         pptr = ipath;
  76. **************
  77. *** 297,299
  78.         pptr = ipath;
  79.         while (trypath(name, file)) {
  80. --- 308,310 -----
  81.         pptr = ipath;
  82. ! #endif                        /* __GNUC__ */
  83.         while (trypath(name, file)) {
  84. **************
  85. *** 304,305
  86.            }
  87.         }
  88. --- 315,317 -----
  89.            }
  90. + #ifdef __GNUC__
  91.         }
  92. **************
  93. *** 305,306
  94.         }
  95.   
  96. --- 317,320 -----
  97.         }
  98. + #endif                        /* __GNUC__ */
  99. +       }
  100.   
  101. **************
  102. *** 371,372
  103.   #if ATARI_ST || HIGHC_386
  104.      {
  105. --- 385,395 -----
  106.   #if ATARI_ST || HIGHC_386
  107. + #ifdef __GNUC__
  108. +    struct stat statb;
  109. +    char lclname[MaxFileName];
  110. +    if (access( makename(lclname,SourceDir,file,U1Suffix), 4 ) == 0 ) {
  111. +       stat(lclname,&statb);
  112. +       if (statb.st_mode & S_IFREG)
  113. +          return 1;
  114. +       }
  115. + #else
  116.      {
  117. **************
  118. *** 381,382
  119.      }
  120.   #endif                    /* ATARI_ST || HIGHC_386 */
  121. --- 404,406 -----
  122.      }
  123. + #endif
  124.   #endif                    /* ATARI_ST || HIGHC_386 */
  125. **************
  126. *** 467,468
  127.      char c;
  128.   
  129. --- 491,493 -----
  130.      char c;
  131. +    char *pptrl;
  132.   
  133. **************
  134. *** 468,472
  135.   
  136. !    while (*pptr == ' ')
  137. !       pptr++;
  138. !    if (!*pptr)
  139.         return 0;
  140. --- 493,517 -----
  141.   
  142. ! #ifndef ORIG
  143. !    /* Check if path separators already occur in 'name' - if yes
  144. !       abandon further search */
  145. ! #if PORT
  146. ! Deliberate Syntax Error
  147. ! #endif                    /* PORT */
  148. ! #if ATARI_ST
  149. !    pptrl = name;
  150. !    while (c = *pptrl++) {
  151. ! #ifdef __GNUC__
  152. !       if ('\\' == c || '/' == c)
  153. ! #else                    /* __GNUC__ */
  154. !       if ('\\' == c)
  155. ! #endif                    /* __GNUC__ */
  156. !          return 0;
  157. !    }
  158. ! #endif                    /* ATARI_ST */
  159. ! #endif                    /* ORIG */
  160. !    pptrl = pptr;
  161. !    while (*pptrl == ' ')
  162. !       pptrl++;
  163. !    if (!*pptrl)
  164.         return 0;
  165. **************
  166. *** 473,475
  167.      do {
  168. !       c = (*file++ = *pptr++);
  169.         }
  170. --- 518,520 -----
  171.      do {
  172. !       c = (*file++ = *pptrl++);
  173.         }
  174. **************
  175. *** 476,478
  176.         while (c != ' ' && c);
  177. !    pptr--;
  178.      file--;
  179. --- 521,523 -----
  180.         while (c != ' ' && c);
  181. !    pptrl--;
  182.      file--;
  183. **************
  184. *** 478,479
  185.      file--;
  186.   
  187. --- 523,525 -----
  188.      file--;
  189. +    pptr = pptrl;
  190.   
  191. **************
  192. *** 502,504
  193.   
  194. ! #if ATARI_ST || MACINTOSH || MVS || VM || VMS
  195.      /* nothing is needed */
  196. --- 548,565 -----
  197.   
  198. ! #if ATARI_ST
  199. !    --file;
  200. ! #ifdef __GNUC__
  201. !    if (('\\' != *file) && ('/' != *file)) {
  202. !       file++;
  203. !      *file = '\\';
  204. !      }
  205. !   file++;
  206. ! #else                    /* __GNUC__ */
  207. !    if ('\\' != *file++) {
  208. !       *file++ = '\\';
  209. !       }
  210. ! #endif
  211. ! #endif                    /* ATARI_ST */
  212. ! #if MACINTOSH || MVS || VM || VMS
  213.      /* nothing is needed */
  214. **************
  215. *** 504,506
  216.      /* nothing is needed */
  217. ! #endif                    /* ATARI_ST || MACINTOSH */
  218.   
  219. --- 565,567 -----
  220.      /* nothing is needed */
  221. ! #endif                    /* MACINTOSH || MVS || VM || VMS */
  222.   
  223. *** old\makefile
  224. --- makefile
  225. **************
  226. *** 0,0
  227. --- 1,95 -----
  228. + CC=gcc
  229. + CFLAGS=-O -fstrength-reduce -fcombine-regs -fomit-frame-pointer
  230. + LFLAGS=-x
  231. + OBJS = err.o keyword.o lcode.o lglob.o link.o llex.o lmem.o lnklist.o \
  232. +     lsym.o opcode.o optab.o parse.o tcode.o tlex.o tmain.o \
  233. +     tmem.o toktab.o trans.o tree.o tsym.o tlocal.o util.o
  234. + COBJS= ..\common\long.o ..\common\getopt.o
  235. + LIBS=-liio
  236. + PGM=icont.ttp
  237. + all: $(PGM)
  238. + $(PGM): $(OBJS) $(COBJS)
  239. +     $(CC) $(CFLAGS) -o $(PGM) $(OBJS) $(COBJS) $(LIBS) $(LFLAGS)
  240. +     toglclr $(PGM) # for TOS 1.4
  241. + clean:
  242. +     $(RM) $(OBJS)
  243. + ###
  244. + err.o : err.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  245. +   ..\common\cproto.h general.h token.h tlex.h trans.h tree.h tproto.h 
  246. + keyword.o : keyword.c ..\h\keyword.h tsym.h 
  247. + lcode.o : lcode.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  248. +   ..\common\cproto.h general.h tproto.h globals.h sizes.h opcode.h \
  249. +   ..\h\opdefs.h link.h ..\h\rt.h ..\h\cpuconf.h ..\h\memsize.h \
  250. +   ..\h\keyword.h ..\h\version.h ..\h\header.h 
  251. + lglob.o : lglob.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  252. +   ..\common\cproto.h general.h tproto.h link.h ..\h\rt.h \
  253. +   ..\h\cpuconf.h ..\h\memsize.h opcode.h ..\h\opdefs.h \
  254. +   ..\h\version.h 
  255. + link.o : link.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  256. +   ..\common\cproto.h general.h tproto.h globals.h sizes.h link.h \
  257. +   ..\h\rt.h ..\h\cpuconf.h ..\h\memsize.h ..\h\paths.h \
  258. +   ..\h\header.h 
  259. + llex.o : llex.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  260. +   ..\common\cproto.h general.h tproto.h link.h ..\h\rt.h \
  261. +   ..\h\cpuconf.h ..\h\memsize.h opcode.h ..\h\opdefs.h 
  262. + lmem.o : lmem.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  263. +   ..\common\cproto.h general.h tproto.h globals.h sizes.h link.h \
  264. +   ..\h\rt.h ..\h\cpuconf.h ..\h\memsize.h 
  265. + lnklist.o : lnklist.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  266. +   ..\common\cproto.h general.h tproto.h trans.h lfile.h 
  267. + lsym.o : lsym.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  268. +   ..\common\cproto.h link.h ..\h\rt.h ..\h\cpuconf.h \
  269. +   ..\h\memsize.h general.h tproto.h globals.h sizes.h 
  270. + opcode.o : opcode.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  271. +   ..\common\cproto.h general.h tproto.h link.h ..\h\rt.h \
  272. +   ..\h\cpuconf.h ..\h\memsize.h opcode.h ..\h\opdefs.h 
  273. + optab.o : optab.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  274. +   ..\common\cproto.h tlex.h 
  275. + parse.o : parse.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  276. +   ..\common\cproto.h tproto.h trans.h tsym.h tree.h ..\h\keyword.h 
  277. + tcode.o : tcode.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  278. +   ..\common\cproto.h general.h tproto.h globals.h sizes.h trans.h \
  279. +   token.h tree.h tsym.h 
  280. + tlex.o : tlex.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  281. +   ..\common\cproto.h general.h tproto.h trans.h token.h tlex.h \
  282. +   tree.h 
  283. + tlocal.o : tlocal.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  284. +   ..\common\cproto.h 
  285. + tmain.o : tmain.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  286. +   ..\common\cproto.h general.h tproto.h ..\h\paths.h globals.h \
  287. +   sizes.h 
  288. + tmem.o : tmem.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  289. +   ..\common\cproto.h general.h tproto.h globals.h sizes.h trans.h \
  290. +   ..\h\memsize.h tsym.h tree.h 
  291. + toktab.o : toktab.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  292. +   ..\common\cproto.h general.h tproto.h trans.h tlex.h token.h 
  293. + trans.o : trans.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  294. +   ..\common\cproto.h general.h tproto.h ..\h\version.h globals.h \
  295. +   sizes.h trans.h tsym.h tree.h token.h 
  296. + tree.o : tree.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  297. +   ..\common\cproto.h general.h tproto.h tree.h 
  298. + tsym.o : tsym.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  299. +   ..\common\cproto.h general.h tproto.h globals.h sizes.h trans.h \
  300. +   token.h tsym.h lfile.h 
  301. + util.o : util.c ..\h\config.h ..\h\define.h ..\h\proto.h \
  302. +   ..\common\cproto.h general.h tproto.h ..\h\cpuconf.h globals.h \
  303. +   sizes.h trans.h tree.h ..\h\fdefs.h 
  304. + ###
  305. + ..\common\long.o : ..\common\long.c ..\h\config.h \
  306. +   ..\h\define.h ..\h\proto.h ..\common\cproto.h ..\h\cpuconf.h 
  307. +     pushd ..\common
  308. +     make long.o
  309. +     popd
  310. + ..\common\getopt.o : ..\common\getopt.c ..\h\config.h \
  311. +   ..\h\define.h ..\h\proto.h ..\common\cproto.h 
  312. +     pushd ..\common
  313. +     make getopt.o
  314. +     popd
  315. *** old\tlocal.c
  316. --- tlocal.c
  317. **************
  318. *** 39,40
  319.   
  320.   unsigned long _STACK = 10240;   /*   MNEED ALSO, PLEASE */
  321. --- 39,43 -----
  322.   
  323. + #ifdef __GNUC__
  324. + extern long _stksize = -1L;    /* grab whole memory for translation */
  325. + #else
  326.   unsigned long _STACK = 10240;   /*   MNEED ALSO, PLEASE */
  327. **************
  328. *** 40,42
  329.   unsigned long _STACK = 10240;   /*   MNEED ALSO, PLEASE */
  330.   #endif                    /* ATARI_ST */
  331. --- 43,45 -----
  332.   unsigned long _STACK = 10240;   /*   MNEED ALSO, PLEASE */
  333. ! #endif
  334.   #endif                    /* ATARI_ST */
  335. *** old\tmain.c
  336. --- tmain.c
  337. **************
  338. *** 9,10
  339.   
  340.   /*
  341. --- 9,14 -----
  342.   
  343. + #if ATARI_ST
  344. + #else
  345. + #define EXECX     /* define if calling iconx is supported */
  346. + #endif /* ATARI_ST */
  347.   /*
  348. **************
  349. *** 13,14
  350.   
  351.   hidden    novalue    execute    Params((char *ofile,char *efile,char * *args));
  352. --- 17,19 -----
  353.   
  354. + #ifdef EXECX
  355.   hidden    novalue    execute    Params((char *ofile,char *efile,char * *args));
  356. **************
  357. *** 14,15
  358.   hidden    novalue    execute    Params((char *ofile,char *efile,char * *args));
  359.   hidden    novalue    report Params((char *s));
  360. --- 19,21 -----
  361.   hidden    novalue    execute    Params((char *ofile,char *efile,char * *args));
  362. + #endif
  363.   hidden    novalue    report Params((char *s));
  364. **************
  365. *** 32,33
  366.   #if ATARI_ST
  367.   char *patharg;
  368. --- 38,40 -----
  369.   #if ATARI_ST
  370. + #ifdef EXECX
  371.   char *patharg;
  372. **************
  373. *** 33,34
  374.   char *patharg;
  375.   #endif                    /* ATARI_ST */
  376. --- 40,42 -----
  377.   char *patharg;
  378. + #endif
  379.   #endif                    /* ATARI_ST */
  380. **************
  381. *** 89,90
  382.      char **rfiles, **rptr;        /* list of files to remove */
  383.      char *efile = NULL;            /* stderr file */
  384. --- 97,99 -----
  385.      char **rfiles, **rptr;        /* list of files to remove */
  386. + #ifdef EXECX
  387.      char *efile = NULL;            /* stderr file */
  388. **************
  389. *** 90,91
  390.      char *efile = NULL;            /* stderr file */
  391.      char buf[MaxFileName];        /* file name construction buffer */
  392. --- 99,101 -----
  393.      char *efile = NULL;            /* stderr file */
  394. + #endif
  395.      char buf[MaxFileName];        /* file name construction buffer */
  396. **************
  397. *** 100,101
  398.   #endif                    /* MACINTOSH */
  399.   
  400. --- 110,115 -----
  401.   #endif                    /* MACINTOSH */
  402. + #ifndef ORIG
  403. +    char *targetdir;
  404. +    char *cptr;
  405. + #endif                    /* ORIG */
  406.   
  407. **************
  408. *** 109,110
  409.               break;
  410.            case 'e':            /* -e file: redirect stderr */
  411. --- 123,125 -----
  412.               break;
  413. + #ifdef EXECX
  414.            case 'e':            /* -e file: redirect stderr */
  415. **************
  416. *** 112,113
  417.               break;
  418.            case 'm':            /* -m: preprocess using m4(1) [UNIX] */
  419. --- 127,130 -----
  420.               break;
  421. + #endif
  422. + #if UNIX
  423.            case 'm':            /* -m: preprocess using m4(1) [UNIX] */
  424. **************
  425. *** 115,116
  426.               break;
  427.            case 'o':            /* -o file: name output file */
  428. --- 132,134 -----
  429.               break;
  430. + #endif
  431.            case 'o':            /* -o file: name output file */
  432. **************
  433. *** 120,121
  434.   #if ATARI_ST
  435.            case 'p':            /* -p path: iconx path [ATARI] */
  436. --- 138,140 -----
  437.   #if ATARI_ST
  438. + #ifdef EXECX
  439.            case 'p':            /* -p path: iconx path [ATARI] */
  440. **************
  441. *** 123,124
  442.               break;
  443.   #endif                    /* ATARI_ST */
  444. --- 142,144 -----
  445.               break;
  446. + #endif
  447.   #endif                    /* ATARI_ST */
  448. **************
  449. *** 135,139
  450.   
  451. -          case 'L':            /* -L: enable linker debugging */
  452.   #ifdef DeBugLinker
  453. --- 155,156 -----
  454.   
  455.   #ifdef DeBugLinker
  456. **************
  457. *** 139,140
  458.   #ifdef DeBugLinker
  459.               Dflag = 1;
  460. --- 156,158 -----
  461.   #ifdef DeBugLinker
  462. +          case 'L':            /* -L: enable linker debugging */
  463.               Dflag = 1;
  464. **************
  465. *** 140,141
  466.               Dflag = 1;
  467.   #endif                    /* DeBugLinker */
  468. --- 158,160 -----
  469.               Dflag = 1;
  470. +             break;
  471.   #endif                    /* DeBugLinker */
  472. **************
  473. *** 142,145
  474.   
  475. -             break;
  476.            case 'S':            /* -Sxnnnn: set a size */
  477. --- 161,162 -----
  478.   
  479.            case 'S':            /* -Sxnnnn: set a size */
  480. **************
  481. *** 147,149
  482.               break;
  483. !          default:
  484.            case 'x':            /* -x illegal until after file list */
  485. --- 164,166 -----
  486.               break;
  487. ! #ifdef EXECX
  488.            case 'x':            /* -x illegal until after file list */
  489. **************
  490. *** 149,150
  491.            case 'x':            /* -x illegal until after file list */
  492.               usage();
  493. --- 166,169 -----
  494.            case 'x':            /* -x illegal until after file list */
  495. + #endif
  496. +          default:
  497.               usage();
  498. **************
  499. *** 152,153
  500.   
  501.      /*
  502. --- 171,199 -----
  503.   
  504. + #ifndef ORIG
  505. + /* establish in which directory create intermediate files */
  506. +    if (nolink || (NULL == (targetdir = getenv("TEMP")))) {
  507. +       targetdir = TargetDir;
  508. +    } else {
  509. +       strcpy(buf, targetdir);
  510. + #if PORT
  511. + Deliberate syntax error
  512. + #endif                    /* PORT */
  513. +    /* Append path separator */
  514. + #if ATARI_ST
  515. +       cptr = buf + strlen(buf) - 1;
  516. + #ifdef __GNUC__
  517. +       if ('\\' != *cptr && '/' != *cptr)
  518. + #else
  519. +       if ('\\' != *cptr)
  520. + #endif
  521. +       {
  522. +          cptr += 1;
  523. +      *cptr++ = '\\';
  524. +      *cptr = '\0';
  525. +      targetdir = salloc (buf);
  526. +       }
  527. + #endif                    /* ATARI_ST */
  528. +    }
  529. + #endif                    /* ORIG */
  530.      /*
  531. **************
  532. *** 164,165
  533.      while (optind < argc)  {
  534.         if (strcmp(argv[optind],"-x") == 0)    /* stop at -x */
  535. --- 210,212 -----
  536.      while (optind < argc)  {
  537. + #ifdef EXECX
  538.         if (strcmp(argv[optind],"-x") == 0)    /* stop at -x */
  539. **************
  540. *** 166,168
  541.            break;
  542. !       else if (strcmp(argv[optind],"-") == 0) {
  543.            *tptr++ = "-";                /* "-" means standard input */
  544. --- 213,217 -----
  545.            break;
  546. !       else
  547. ! #endif
  548. !       if (strcmp(argv[optind],"-") == 0) {
  549.            *tptr++ = "-";                /* "-" means standard input */
  550. **************
  551. *** 168,169
  552.            *tptr++ = "-";                /* "-" means standard input */
  553.            *lptr++ = *rptr++ = "stdin.u1";
  554. --- 217,219 -----
  555.            *tptr++ = "-";                /* "-" means standard input */
  556. + #ifdef ORIG
  557.            *lptr++ = *rptr++ = "stdin.u1";
  558. **************
  559. *** 170,171
  560.            *rptr++ = "stdin.u2";
  561.            }
  562. --- 220,228 -----
  563.            *rptr++ = "stdin.u2";
  564. + #else
  565. +      strcpy(buf, targetdir);
  566. +      strcat(buf, "stdin.u1");
  567. +          *lptr++ = *rptr++ = salloc(buf);
  568. +      buf[strlen(buf) - 1] = '2';  /* "...stdin.u2" */
  569. +          *rptr++ = salloc(buf);
  570. + #endif                    /* ORIG */
  571.            }
  572. **************
  573. *** 176,177
  574.               *tptr++ = salloc(buf);        /* translate the .icn file */
  575.               makename(buf,TargetDir,argv[optind],U1Suffix);
  576. --- 233,235 -----
  577.               *tptr++ = salloc(buf);        /* translate the .icn file */
  578. + #ifdef ORIG
  579.               makename(buf,TargetDir,argv[optind],U1Suffix);
  580. **************
  581. *** 179,180
  582.               makename(buf,TargetDir,argv[optind],U2Suffix);
  583.               *rptr++ = salloc(buf);        /* also remove .u2 */
  584. --- 237,243 -----
  585.               makename(buf,TargetDir,argv[optind],U2Suffix);
  586. + #else
  587. +             makename(buf,targetdir,argv[optind],U1Suffix);
  588. +             *lptr++ = *rptr++ = salloc(buf);    /* link & remove .u1 */
  589. +             makename(buf,targetdir,argv[optind],U2Suffix);
  590. + #endif                    /* ORIG */
  591.               *rptr++ = salloc(buf);        /* also remove .u2 */
  592. **************
  593. *** 183,184
  594.                  || smatch(fp->ext,USuffix)) {
  595.               makename(buf,TargetDir,argv[optind],U1Suffix);
  596. --- 246,248 -----
  597.                  || smatch(fp->ext,USuffix)) {
  598. + #ifdef ORIG
  599.               makename(buf,TargetDir,argv[optind],U1Suffix);
  600. **************
  601. *** 184,185
  602.               makename(buf,TargetDir,argv[optind],U1Suffix);
  603.               *lptr++ = salloc(buf);
  604. --- 248,254 -----
  605.               makename(buf,TargetDir,argv[optind],U1Suffix);
  606. + #else
  607. +         /* we do not want to change locations of files to link */
  608. +             makename(buf,SourceDir,argv[optind],U1Suffix);
  609. + #endif                    /* ORIG */
  610.               *lptr++ = salloc(buf);
  611. **************
  612. *** 211,212
  613.            report("Translating");
  614.         errors = trans(tfiles);
  615. --- 280,282 -----
  616.            report("Translating");
  617. + #ifdef ORIG
  618.         errors = trans(tfiles);
  619. **************
  620. *** 212,213
  621.         errors = trans(tfiles);
  622.         if (errors > 0)            /* exit if errors seen */
  623. --- 282,286 -----
  624.         errors = trans(tfiles);
  625. + #else
  626. +       errors = trans(tfiles, rfiles);
  627. + #endif                    /* ORIG */
  628.         if (errors > 0)            /* exit if errors seen */
  629. **************
  630. *** 275,276
  631.   
  632.      if (optind < argc)  {
  633. --- 348,350 -----
  634.   
  635. + #ifdef EXECX
  636.      if (optind < argc)  {
  637. **************
  638. *** 280,281
  639.         }
  640.   
  641. --- 354,356 -----
  642.         }
  643. + #endif
  644.   
  645. **************
  646. *** 284,285
  647.   
  648.   /*
  649. --- 359,361 -----
  650.   
  651. + #ifdef EXECX
  652.   /*
  653. **************
  654. *** 443,444
  655.      }
  656.   
  657. --- 519,521 -----
  658.      }
  659. + #endif  /* EXECX */
  660.   
  661. **************
  662. *** 524,525
  663.      {
  664.      fprintf(stderr,"usage: %s %s file ... [-x args]\n", progname, Usage);
  665. --- 601,603 -----
  666.      {
  667. + #ifdef EXECX
  668.      fprintf(stderr,"usage: %s %s file ... [-x args]\n", progname, Usage);
  669. **************
  670. *** 525,526
  671.      fprintf(stderr,"usage: %s %s file ... [-x args]\n", progname, Usage);
  672.      exit(ErrorExit);
  673. --- 603,615 -----
  674.      fprintf(stderr,"usage: %s %s file ... [-x args]\n", progname, Usage);
  675. + #else
  676. + #if ATARI_ST
  677. + #undef Usage
  678. + #ifdef DeBugLinker
  679. + #define Usage "[-cstuL] [-o ofile] [-Sxnnnn]"
  680. + #else        /* DeBugLinker */
  681. + #define Usage "[-cstu] [-o ofile] [-Sxnnnn]"
  682. + #endif        /* DeBugLinker */
  683. + #endif        /* ATARI_ST */
  684. +    fprintf(stderr,"usage: %s %s file ... \n", progname, Usage);
  685. + #endif
  686.      exit(ErrorExit);
  687. *** old\tproto.h
  688. --- tproto.h
  689. **************
  690. *** 8,10
  691.   int    blocate            Params((char *s));
  692. ! struct    node *c_str_leaf Params((int type,struct node *loc_model,char *c));
  693.   novalue    codegen            Params((struct node *t));
  694. --- 8,12 -----
  695.   int    blocate            Params((char *s));
  696. ! struct    node *c_str_leaf    Params((int type,
  697. !                     struct node *loc_model,
  698. !                     char *c));
  699.   novalue    codegen            Params((struct node *t));
  700. **************
  701. *** 29,31
  702.   novalue    gout            Params((FILE *fd));
  703. ! struct    node *i_str_leaf Params((int type,struct node *loc_model,char *c,int d));
  704.   int    ilink            Params((char * *ifiles,char *outname));
  705. --- 31,36 -----
  706.   novalue    gout            Params((FILE *fd));
  707. ! struct    node *i_str_leaf    Params((int type,
  708. !                     struct node *loc_model,
  709. !                     char *c,
  710. !                     int d));
  711.   int    ilink            Params((char * *ifiles,char *outname));
  712. **************
  713. *** 48,50
  714.   novalue    putfield        Params((char *fname,int rnum,int fnum));
  715. ! struct    gentry *putglobal    Params((char *id,int flags,int nargs,int procid));
  716.   char    *putid            Params((int len));
  717. --- 53,58 -----
  718.   novalue    putfield        Params((char *fname,int rnum,int fnum));
  719. ! struct    gentry *putglobal    Params((char *id,
  720. !                     int flags,
  721. !                     int nargs,
  722. !                     int procid));
  723.   char    *putid            Params((int len));
  724. **************
  725. *** 67,68
  726.   novalue    tminit            Params((noargs));
  727.   int    trans            Params((char * *ifiles));
  728. --- 75,77 -----
  729.   novalue    tminit            Params((noargs));
  730. + #ifdef ORIG
  731.   int    trans            Params((char * *ifiles));
  732. **************
  733. *** 68,69
  734.   int    trans            Params((char * *ifiles));
  735.   struct    node *tree1        Params((int type));
  736. --- 77,81 -----
  737.   int    trans            Params((char * *ifiles));
  738. + #else
  739. + int    trans            Params((char **ifiles, char **ufiles));
  740. + #endif                    /* ORIG */
  741.   struct    node *tree1        Params((int type));
  742. **************
  743. *** 70,75
  744.   struct    node *tree2        Params((int type,struct node *loc_model));
  745. ! struct    node *tree3        Params((int type,struct node *loc_model,struct node *c));
  746. ! struct    node *tree4        Params((int type,struct node *loc_model,struct node *c,struct node *d));
  747. ! struct    node *tree5 Params((int type,struct node *loc_model,struct node *c,struct node *d, struct node *e));
  748. ! struct    node *tree6        Params((int type,struct node *loc_model,struct node *c, struct node *e, struct node *d, struct node *e, struct node *f));
  749.   novalue    treeinit        Params((noargs));
  750. --- 82,101 -----
  751.   struct    node *tree2        Params((int type,struct node *loc_model));
  752. ! struct    node *tree3        Params((int type,
  753. !                     struct node *loc_model,
  754. !                     struct node *c));
  755. ! struct    node *tree4        Params((int type,
  756. !                     struct node *loc_model,
  757. !                     struct node *c,
  758. !                     struct node *d));
  759. ! struct    node *tree5        Params((int type,
  760. !                     struct node *loc_model,
  761. !                     struct node *c,
  762. !                     struct node *d,
  763. !                     struct node *e));
  764. ! struct    node *tree6        Params((int type,
  765. !                     struct node *loc_model,
  766. !                     struct node *c,
  767. !                     struct node *d,
  768. !                     struct node *e,
  769. !                     struct node *f));
  770.   novalue    treeinit        Params((noargs));
  771. *** old\trans.c
  772. --- trans.c
  773. **************
  774. *** 18,19
  775.   
  776.   hidden    FILE    *preprocess    Params((char *filename));
  777. --- 18,20 -----
  778.   
  779. + #if UNIX
  780.   hidden    FILE    *preprocess    Params((char *filename));
  781. **************
  782. *** 19,20
  783.   hidden    FILE    *preprocess    Params((char *filename));
  784.   hidden    novalue    trans1        Params((char *filename));
  785. --- 20,23 -----
  786.   hidden    FILE    *preprocess    Params((char *filename));
  787. + #endif
  788. + #ifdef ORIG
  789.   hidden    novalue    trans1        Params((char *filename));
  790. **************
  791. *** 20,21
  792.   hidden    novalue    trans1        Params((char *filename));
  793.   
  794. --- 23,29 -----
  795.   hidden    novalue    trans1        Params((char *filename));
  796. + #else
  797. + hidden    novalue    trans1        Params((char *filename,
  798. +                     char *u1name,
  799. +                     char *u2name));
  800. + #endif                    /* ORIG */
  801.   
  802. **************
  803. *** 33,34
  804.   
  805.   /*
  806. --- 41,43 -----
  807.   
  808. + #ifdef ORIG
  809.   /*
  810. **************
  811. *** 38,39
  812.   char **ifiles;
  813.      {
  814. --- 47,58 -----
  815.   char **ifiles;
  816. + #else
  817. + /*
  818. +  * translate a number of files, returning an error count;
  819. +  * ufiles is a list of names of intermediate files corresponding
  820. +  * to source files on ifiles list
  821. +  */
  822. + int trans(ifiles, ufiles)
  823. + char **ifiles;
  824. + char **ufiles;
  825. + #endif                    /* ORIG */
  826.      {
  827. **************
  828. *** 47,48
  829.      while (*ifiles)
  830.         trans1(*ifiles++);    /* translate each file in turn */
  831. --- 66,68 -----
  832.      while (*ifiles)
  833. + #ifdef ORIG
  834.         trans1(*ifiles++);    /* translate each file in turn */
  835. **************
  836. *** 48,49
  837.         trans1(*ifiles++);    /* translate each file in turn */
  838.      tmfree();            /* free memory used for translation */
  839. --- 68,76 -----
  840.         trans1(*ifiles++);    /* translate each file in turn */
  841. + #else
  842. +    {
  843. +       char *u1name = *ufiles++;
  844. +       trans1(*ifiles++, u1name, *ufiles++);
  845. +                 /* translate each file in turn */
  846. +    }
  847. + #endif                    /* ORIG */
  848.      tmfree();            /* free memory used for translation */
  849. **************
  850. *** 63,64
  851.   
  852.   /*
  853. --- 90,92 -----
  854.   
  855. + #ifdef ORIG
  856.   /*
  857. **************
  858. *** 68,69
  859.   char *filename;
  860.   {
  861. --- 96,106 -----
  862.   char *filename;
  863. + #else
  864. + /*
  865. +  * translate one file creating intermediate code in u1name and u2name
  866. +  */
  867. + static novalue trans1(filename, u1name, u2name)
  868. + char *filename;
  869. + char *u1name;
  870. + char *u2name;
  871. + #endif                    /* ORIG */
  872.   {
  873. **************
  874. *** 69,70
  875.   {
  876.      char oname[MaxFileName];    /* buffer for constructing file names */
  877. --- 106,108 -----
  878.   {
  879. + #ifdef ORIG
  880.      char oname[MaxFileName];    /* buffer for constructing file names */
  881. **************
  882. *** 70,71
  883.      char oname[MaxFileName];    /* buffer for constructing file names */
  884.   
  885. --- 108,110 -----
  886.      char oname[MaxFileName];    /* buffer for constructing file names */
  887. + #endif                    /* ORIG */
  888.   
  889. **************
  890. *** 78,79
  891.   
  892.      if (m4pre)
  893. --- 117,119 -----
  894.   
  895. + #if UNIX
  896.      if (m4pre)
  897. **************
  898. *** 80,82
  899.         srcfile = preprocess(filename);
  900. !    else if (strcmp(filename,"-") == 0) {
  901.         srcfile = stdin;
  902. --- 120,124 -----
  903.         srcfile = preprocess(filename);
  904. !    else
  905. ! #endif
  906. !    if (strcmp(filename,"-") == 0) {
  907.         srcfile = stdin;
  908. **************
  909. *** 97,98
  910.   
  911.      makename(oname, TargetDir, filename, U1Suffix);
  912. --- 139,141 -----
  913.   
  914. + #ifdef ORIG
  915.      makename(oname, TargetDir, filename, U1Suffix);
  916. **************
  917. *** 98,99
  918.      makename(oname, TargetDir, filename, U1Suffix);
  919.   
  920. --- 141,143 -----
  921.      makename(oname, TargetDir, filename, U1Suffix);
  922. + #endif                    /* ORIG */
  923.   
  924. **************
  925. *** 106,107
  926.    */
  927.      codefile = fopen(oname, WriteBinary);   /* avoid line splits */
  928. --- 150,152 -----
  929.    */
  930. + #ifdef ORIG
  931.      codefile = fopen(oname, WriteBinary);   /* avoid line splits */
  932. **************
  933. *** 107,108
  934.      codefile = fopen(oname, WriteBinary);   /* avoid line splits */
  935.   #else                    /* MVS || VM */
  936. --- 152,156 -----
  937.      codefile = fopen(oname, WriteBinary);   /* avoid line splits */
  938. + #else
  939. +    codefile = fopen(u1name, WriteBinary);   /* avoid line splits */
  940. + #endif                    /* ORIG */
  941.   #else                    /* MVS || VM */
  942. **************
  943. *** 108,109
  944.   #else                    /* MVS || VM */
  945.      codefile = fopen(oname, WriteText);
  946. --- 156,158 -----
  947.   #else                    /* MVS || VM */
  948. + #ifdef ORIG
  949.      codefile = fopen(oname, WriteText);
  950. **************
  951. *** 109,110
  952.      codefile = fopen(oname, WriteText);
  953.   #endif                    /* MVS || VM */
  954. --- 158,162 -----
  955.      codefile = fopen(oname, WriteText);
  956. + #else
  957. +    codefile = fopen(u1name, WriteText);
  958. + #endif                    /* ORIG */
  959.   #endif                    /* MVS || VM */
  960. **************
  961. *** 112,113
  962.      if (codefile == NULL)
  963.         quitf("cannot create %s", oname);
  964. --- 164,168 -----
  965.      if (codefile == NULL)
  966. + #ifndef ORIG
  967. +       quitf("cannot create %s", u1name);
  968. + #else
  969.         quitf("cannot create %s", oname);
  970. **************
  971. *** 115,116
  972.      makename(oname, TargetDir, filename, U2Suffix);
  973.   
  974. --- 170,172 -----
  975.      makename(oname, TargetDir, filename, U2Suffix);
  976. + #endif                    /* ORIG */
  977.   
  978. **************
  979. *** 117,118
  980.   #if MVS || VM
  981.      globfile = fopen(oname, WriteBinary);
  982. --- 173,175 -----
  983.   #if MVS || VM
  984. + #ifdef ORIG
  985.      globfile = fopen(oname, WriteBinary);
  986. **************
  987. *** 118,119
  988.      globfile = fopen(oname, WriteBinary);
  989.   #else                    /* MVS || VM */
  990. --- 175,179 -----
  991.      globfile = fopen(oname, WriteBinary);
  992. + #else
  993. +    globfile = fopen(u2name, WriteBinary);
  994. + #endif                    /* ORIG */
  995.   #else                    /* MVS || VM */
  996. **************
  997. *** 119,120
  998.   #else                    /* MVS || VM */
  999.      globfile = fopen(oname, WriteText);
  1000. --- 179,181 -----
  1001.   #else                    /* MVS || VM */
  1002. + #ifdef ORIG
  1003.      globfile = fopen(oname, WriteText);
  1004. **************
  1005. *** 120,121
  1006.      globfile = fopen(oname, WriteText);
  1007.   #endif                    /* MVS || VM */
  1008. --- 181,185 -----
  1009.      globfile = fopen(oname, WriteText);
  1010. + #else
  1011. +    globfile = fopen(u2name, WriteText);
  1012. + #endif                    /* ORIG */
  1013.   #endif                    /* MVS || VM */
  1014. **************
  1015. *** 123,124
  1016.      if (globfile == NULL)
  1017.         quitf("cannot create %s", oname);
  1018. --- 187,189 -----
  1019.      if (globfile == NULL)
  1020. + #ifdef ORIG
  1021.         quitf("cannot create %s", oname);
  1022. **************
  1023. *** 124,125
  1024.         quitf("cannot create %s", oname);
  1025.      writecheck(fprintf(globfile,"version\t%s\n",UVersion));
  1026. --- 189,193 -----
  1027.         quitf("cannot create %s", oname);
  1028. + #else
  1029. +       quitf("cannot create %s", u2name);
  1030. + #endif                    /* ORIG */
  1031.      writecheck(fprintf(globfile,"version\t%s\n",UVersion));
  1032. **************
  1033. *** 161,162
  1034.   
  1035.   /*
  1036. --- 229,231 -----
  1037.   
  1038. + #if UNIX
  1039.   /*
  1040. **************
  1041. *** 186
  1042.   }
  1043. --- 255,256 -----
  1044.   }
  1045. + #endif                    /* UNIX */
  1046. *** old\util.c
  1047. --- util.c
  1048. **************
  1049. *** 264,266
  1050.   #define MinSize(x,y,z)
  1051. ! #include "sizes.h"            \* initialize from "sizes.h" data *\
  1052.   #undef Size
  1053. --- 264,266 -----
  1054.   #define MinSize(x,y,z)
  1055. ! #include "sizes.h"            /* initialize from "sizes.h" data */
  1056.   #undef Size
  1057.